package grape.attend.service.group.api;

import grape.attend.service.group.po.Group;
import grape.attend.service.vacation.po.Vacation;
import grape.common.service.common.IBaseService;
import grape.common.service.trans.ITransService;

import java.util.List;

/**
 * <p>
 *  考勤组设置表 服务类
 * </p>
 *
 * @author yangwei
 * @since 2020-05-08
 */
public interface IGroupService extends IBaseService<Group> , ITransService<String,String> {
    public static final String trans_groupName = "trans_groupName";

    /**
     * 获取用户的考勤组
     * @param userId
     * @return
     */
    List<Group> getGroupByUserId(String userId);

    @Override
    default boolean support(String type){
        return isEqualAny(type,trans_groupName);
    }

    @Override
    default String trans(String type, String key){
        if (isEqual(type,trans_groupName)) {
            Group po = getById(key);
            return po.getName();
        }
        return null;
    }
}
